package com.grep.base.jsoup;

import java.io.File;
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class AnalysispageContent {

	public static void main(String[] args) {
		
		String website = "http://www.4399.com";
		
		String separator = File.separator;
		String baseUri = "F:" + separator + "4399game" + separator + "4399tiyu"
				+ separator + "1.html";
		File input = new File(baseUri);
		Document doc;
		try {
			doc = Jsoup.parse(input, "GB2312");
			Elements elements = doc.select(".lbg2>h1");
			Elements href = doc.select(".listart>a");
			System.out.println(website+href.attr("href"));
			System.out.println(elements.text());
			
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
